<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <form class="form-horizontal" id="form" method="post" action="{$method}">
                            <!-- PAGE CONTENT BEGINS -->
                            <input type="hidden" name="id" value="{$vo.id}"/>
                            <input type="hidden" name="p" value="{$p}"/>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    手机号 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="mobile" id="mobile" maxlength="11" placeholder="输入手机号"
                                           class="col-xs-10 col-sm-5" value="{$vo['mobile']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">手机号不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    内容 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="content" id="content" placeholder="输入动态内容"
                                           class="col-xs-10 col-sm-5" value="{$vo['content']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">动态内容不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
							
							<div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="id-date-picker-1">时间</label>
                                <div class="col-xs-9 col-sm-9">
                                    <div class="input-group col-xs-5">
                                        <input class="form-control" id="puth_date" name="t"
                                               <if condition="$vo['t'] neq ''">value="{$vo['t']|date=" Y-m-d H:i:s",###}"<else/>value="{$nowtime}"</if> type="text"/>
                                        <span class="input-group-addon">
													<i class="ace-icon fa fa-calendar bigger-110"></i>
												</span>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info submit" type="button">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="button" onclick="history.back(-1);">
                                    <i class="icon-undo bigger-110"></i>
                                    取消
                                </button>
                            </div>

                            <!-- PAGE CONTENT ENDS -->


                        </form>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<script type="text/javascript" src="__PUBLIC__/qwadmin/laydate/laydate.js"></script>
<!-- inline scripts related to this page -->
<script type="text/javascript">
	//时间选择器
	laydate.render({
	  elem: '#puth_date'
	  ,type: 'datetime'
	});
    $(function () {
        $("#tabs").tabs();
        $(".submit").click(function () {
            var mobile = $("#mobile").val(); 
            var content = $("#content").val();
            var puth_date = $("#puth_date").val();
            if (mobile == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "手机号不能为空",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if(!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(mobile))){ 
            	bootbox.dialog({
                    title: '友情提示：',
                    message: "手机号输入错误",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            } 
            
            if (content == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "动态内容必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (puth_date == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "时间必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            $("#form").submit();
        });
    });
</script>
</body>
</html>
